public class Student {
    private int id;
    private String name;
    private int classId;
    private int groupId;
    private int attendance;
    private int absences;
    private int lateCount;
    private int totalScore;
    private int answerCount;
    
    public Student(int id, String name, int classId, int groupId) {
        this.id = id;
        this.name = name;
        this.classId = classId;
        this.groupId = groupId;
        this.attendance = 0;
        this.absences = 0;
        this.lateCount = 0;
        this.totalScore = 0;
        this.answerCount = 0;
    }
    
    // Getters and Setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public int getClassId() { return classId; }
    public void setClassId(int classId) { this.classId = classId; }
    public int getGroupId() { return groupId; }
    public void setGroupId(int groupId) { this.groupId = groupId; }
    public int getAttendance() { return attendance; }
    public int getAbsences() { return absences; }
    public int getLateCount() { return lateCount; }
    public int getTotalScore() { return totalScore; }
    public int getAnswerCount() { return answerCount; }
    public double getAverageScore() {
        return answerCount == 0 ? 0 : (double) totalScore / answerCount;
    }
    
    public void recordAttendance(int status) {
        switch (status) {
            case 1 -> attendance++; // 出勤
            case 0 -> absences++;   // 缺勤
            case 2 -> lateCount++;  // 迟到
        }
    }
    
    public void addScore(int score) {
        this.totalScore += score;
        this.answerCount++;
    }
} 